import request from '@/utils/request'

// 获取泵组下拉列表
export function getPumpGroupList() {
  return request({
    url: '/dispatch/dispatch/dispatchSchedulePlan/pumpGroupList',
    method: 'get'
  })
}

// 查询调度计划列表
export function listSchedulePlan(params) {
  return request({
    url: '/dispatch/dispatch/dispatchSchedulePlan/list',
    method: 'get',
    params
  })
}

// 获取调度计划详细信息
export function getSchedulePlanDetail(schedulePlanId) {
  return request({
    url: `/dispatch/dispatch/dispatchSchedulePlan/detail/${schedulePlanId}`,
    method: 'get'
  })
}

// 新增调度计划
export function addSchedulePlan(data) {
  return request({
    url: '/dispatch/dispatch/dispatchSchedulePlan',
    method: 'post',
    data
  })
}

// 修改调度计划
export function updateSchedulePlan(data) {
  return request({
    url: '/dispatch/dispatch/dispatchSchedulePlan',
    method: 'put',
    data
  })
}

// 删除调度计划
export function deleteSchedulePlan(ids) {
  return request({
    url: `/dispatch/dispatch/dispatchSchedulePlan/${ids}`,
    method: 'delete'
  })
}

// 发布调度计划
export function publishSchedulePlan(id) {
  return request({
    url: `/dispatch/dispatch/dispatchSchedulePlan/publish/${id}`,
    method: 'post'
  })
}

// 执行调度计划
export function executeSchedulePlan(data) {
  return request({
    url: '/dispatch/dispatch/dispatchSchedulePlan/execute',
    method: 'post',
    data
  })
}